# Copyright 2018- The Pixie Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel:pl_build_system.bzl", "pl_go_binary")

package(default_visibility = ["//src/carnot/docstring/tables:__subpackages__"])

# Binary that creates the datatable docstrings using the pxapi.
# Takes 3 arguments -> cluster_id, api_key, output_json
# TODO(htroisi): get the tables from Stirling.
pl_go_binary(
    name = "datatables",
    embed = [":tables_lib"],
    importpath = "px.dev/pixie/src/carnot/docstring/tables",
)

go_library(
    name = "tables_lib",
    srcs = ["datatables.go"],
    importpath = "px.dev/pixie/src/carnot/docstring/tables",
    deps = [
        "//src/api/go/pxapi",
        "//src/api/go/pxapi/errdefs",
        "//src/api/go/pxapi/muxes",
        "//src/api/go/pxapi/types",
        "//src/shared/services",
        "@com_github_sirupsen_logrus//:logrus",
        "@com_github_spf13_pflag//:pflag",
        "@com_github_spf13_viper//:viper",
    ],
)
